package com.daoeping.action;

import java.util.ArrayList;
import java.util.List;
import com.daoeping.data.Bsc_salary;
import com.daoeping.data.Bsc_worktype;
import com.daoeping.domain.JsonData;
import com.daoeping.service.Bsc_salaryService;
import com.daoeping.util.ConverntJsonData;
import com.opensymphony.xwork2.ActionSupport;

public class Bsc_salaryAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = -9204856517013289282L;
	private Bsc_salaryService bsc_salaryService;
	private JsonData jsonData;
	private List<Bsc_salary> bsc_salaryList;
	
	
	public Bsc_salaryService getBsc_salaryService() {
		return bsc_salaryService;
	}

	public void setBsc_salaryService(Bsc_salaryService bsc_salaryService) {
		this.bsc_salaryService = bsc_salaryService;
	}

	public List<Bsc_salary> getBsc_salaryList() {
		return bsc_salaryList;
	}

	public void setBsc_salaryList(List<Bsc_salary> bsc_salaryList) {
		this.bsc_salaryList = bsc_salaryList;
	}

	public JsonData getJsonData() {
		return jsonData;
	}

	public void setJsonData(JsonData jsonData) {
		this.jsonData = jsonData;
	}

	

	public String findAllSalary(){
		jsonData = new JsonData();
		bsc_salaryList = bsc_salaryService.findBsc_salaryList();
		List <String[]> strList = new ArrayList<String[]>();
		for (Bsc_salary bsc_salary : bsc_salaryList) {
			String [] strarr = new String[2];
			strarr[1] = bsc_salary.getId()+"";
			strarr[0] = bsc_salary.getSalaryTo()+"";
			strList.add(strarr);
		}
		jsonData.setJsonData( new ConverntJsonData().getJsonData(strList)+"");
		return "allsalary";
		
	}
	
	public List<Bsc_salary> findBsc_salaryList(){
		return this.bsc_salaryService.findBsc_salaryList();
	}
}
